Socket
Socket
Sign inDemoInstall

lodash.omit

Package Overview
Dependencies
Maintainers
5
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash.omit

The modern build of lodash’s `_.omit` as a module.


Version published
Maintainers
5
Created

What is lodash.omit?

The lodash.omit package is a utility library that allows you to create a new object by omitting specified properties from an existing object. This can be particularly useful for removing sensitive information, simplifying objects, or preparing data for certain operations.

What are lodash.omit's main functionalities?

Omitting Single Property

This feature allows you to omit a single property from an object. In the example, the property 'a' is omitted from the object.

const omit = require('lodash.omit');
const object = { 'a': 1, 'b': 2, 'c': 3 };
const result = omit(object, ['a']);
console.log(result); // { 'b': 2, 'c': 3 }

Omitting Multiple Properties

This feature allows you to omit multiple properties from an object. In the example, the properties 'a' and 'c' are omitted from the object.

const omit = require('lodash.omit');
const object = { 'a': 1, 'b': 2, 'c': 3, 'd': 4 };
const result = omit(object, ['a', 'c']);
console.log(result); // { 'b': 2, 'd': 4 }

Omitting Properties Using a Function

This feature allows you to omit properties based on a function. In the example, properties where the key is 'a' or the value is 3 are omitted.

const omit = require('lodash.omit');
const object = { 'a': 1, 'b': 2, 'c': 3, 'd': 4 };
const result = omit(object, (value, key) => key === 'a' || value === 3);
console.log(result); // { 'b': 2, 'd': 4 }

Other packages similar to lodash.omit

Keywords

FAQs

Package last updated on 25 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc